/* *****************************************************
    ** Custom Modern Stylesheet **
    Modern, simple, functional and fully responsive design
***************************************************** */

:root {
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --secondary-color: #f1f5f9;
    --accent-color: #06b6d4;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-gray: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-gray);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Container Improvements */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 15px;
}

/* Header Section - Always visible */
section#header {
    background-color: white;
    box-shadow: var(--shadow-md);
    border-radius: 0;
    margin: 0;
    padding: 1rem 0;
    display: block;
    visibility: visible;
    position: relative;
    z-index: 1000;
    width: 100%;
}

section#header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section#header .logo {
    display: inline-block;
    vertical-align: middle;
}

section#header .logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

section#header .text-right {
    text-align: right;
}

/* Main Menu Navigation */
section#main-menu {
    display: block;
    visibility: visible;
    position: relative;
    z-index: 999;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Main Body Section */
section#main-body {
    padding: 1.5rem 0;
    min-height: auto;
    clear: both;
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    background-color: var(--bg-gray);
    overflow: hidden;
}

section#main-body::after {
    content: "";
    display: block;
    clear: both;
    height: 0;
    visibility: hidden;
}

/* Ensure container clears floats */
section#main-body .container::after {
    content: "";
    display: table;
    clear: both;
}

/* Fix row positioning */
section#main-body .container .row {
    margin-top: 0;
    margin-bottom: 0;
}

/* Ensure sidebar starts at top */
@media (min-width: 992px) {
    section#main-body .row > .col-md-3.pull-md-left.sidebar {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Pageheader column should be at top right */
    section#main-body .row > .col-md-9.pull-md-right:first-of-type {
        margin-top: 0;
        padding-top: 0;
    }
}

/* Bootstrap Grid System - Float based */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

.row::before,
.row::after {
    content: " ";
    display: table;
}

.row::after {
    clear: both;
}

/* Column System */
[class*="col-"] {
    position: relative;
    min-height: 1px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

.col-xs-12 {
    width: 100%;
    float: none;
}

.col-sm-6 {
    width: 50%;
    float: left;
}

.col-sm-12 {
    width: 100%;
    float: none;
}

@media (min-width: 992px) {
    .col-md-3 {
        width: 25%;
        float: left;
    }
    
    .col-md-9 {
        width: 75%;
        float: left;
    }
    
    .pull-md-left {
        float: left !important;
        clear: left;
    }
    
    .pull-md-right {
        float: right !important;
    }
    
    /* Ensure sidebar is at top left */
    section#main-body .col-md-3.pull-md-left.sidebar {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Main content with pageheader inside should be at top right */
    section#main-body .col-md-9.pull-md-right.main-content {
        margin-top: 0;
        padding-top: 0;
    }
}

@media (max-width: 991px) {
    .col-md-3,
    .col-md-9 {
        width: 100% !important;
        float: none !important;
    }
    
    .pull-md-left,
    .pull-md-right {
        float: none !important;
    }
}

.clearfix::before,
.clearfix::after {
    content: " ";
    display: table;
}

.clearfix::after {
    clear: both;
}

/* Main Content */
.main-content {
    background-color: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    position: relative;
    margin-top: 0;
}

/* When pageheader is separate, main-content should be right after it */
@media (min-width: 992px) {
    section#main-body .col-md-9.pull-md-right + .col-md-9.pull-md-right.main-content {
        margin-top: 0;
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        border-radius: 0;
    }
}

/* Sidebar */
.sidebar {
    margin-bottom: 2rem;
    position: relative;
}

@media (min-width: 992px) {
    .sidebar {
        margin-bottom: 0;
        margin-top: 0;
        padding-top: 0;
    }
    
    .sidebar.pull-md-left {
        float: left;
        clear: left;
    }
}

@media (max-width: 991px) {
    .sidebar {
        width: 100% !important;
        float: none !important;
        clear: both;
        margin-bottom: 2rem;
    }
}

/* Top Navigation Bar */
ul.top-nav {
    margin-top: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.top-nav > li {
    display: inline-block;
}

ul.top-nav > li > a {
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
}

ul.top-nav > li > a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

ul.top-nav > li.primary-action > a.btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

ul.top-nav > li.primary-action > a.btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Main Menu Navigation */
.navbar-main {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.navbar-main .navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-weight: 500;
}

.navbar-main .navbar-nav > li > a:hover,
.navbar-main .navbar-nav > li > a:focus {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
}

.navbar-main .navbar-nav > .active > a,
.navbar-main .navbar-nav > .active > a:hover,
.navbar-main .navbar-nav > .active > a:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.navbar-main .dropdown-menu {
    background-color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.navbar-main .dropdown-menu > li > a {
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.navbar-main .dropdown-menu > li > a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Panel Modernization */
.panel {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    background-color: var(--bg-color);
    transition: var(--transition);
    overflow: hidden;
}

.panel:hover {
    box-shadow: var(--shadow-md);
}

.panel-heading {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: visible;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: white;
    position: relative;
    overflow: visible;
    display: block;
    min-height: 1.5em;
}

/* Fix for pull-right in panel-title */
.panel-title .pull-right {
    float: right;
    margin-left: 1rem;
    position: relative;
    z-index: 1;
    clear: right;
}

/* Client home panels specific styles */
.client-home-panels .panel > .panel-heading {
    position: relative;
    overflow: visible;
    padding: 1rem 1.5rem;
    min-height: 3rem;
    width: 100%;
    box-sizing: border-box;
}

.client-home-panels .panel > .panel-heading::after {
    content: "";
    display: table;
    clear: both;
}

.client-home-panels .panel > .panel-heading .panel-title {
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 1.5;
    min-height: 2rem;
    box-sizing: border-box;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
}

.client-home-panels .panel > .panel-heading .panel-title::after {
    content: "";
    display: none;
}

.client-home-panels .panel > .panel-heading .panel-title > *:not(.pull-right) {
    flex: 1;
    min-width: 0;
}

.client-home-panels .panel > .panel-heading .panel-title .pull-right {
    float: none;
    margin-left: auto;
    margin-top: 0;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    order: 2;
}

.client-home-panels .panel > .panel-heading .panel-title .btn {
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

.panel-body {
    padding: 1.5rem;
}

.panel-footer {
    background-color: var(--bg-gray);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Panel Accents */
.panel-accent-blue {
    border-top: 4px solid #3b82f6;
}

.panel-accent-green {
    border-top: 4px solid var(--success-color);
}

.panel-accent-red {
    border-top: 4px solid var(--error-color);
}

.panel-accent-gold {
    border-top: 4px solid var(--warning-color);
}

/* List Group Improvements */
.list-group {
    border: none;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    transition: var(--transition);
    background-color: transparent;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--secondary-color);
    padding-left: 2rem;
}

.list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.list-group-item.active:hover {
    background-color: var(--primary-dark);
}

/* Buttons Modernization */
.btn {
    border-radius: var(--radius);
    padding: 0.625rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-default {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Fix for WHMCS buttons with low contrast */
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger {
    color: white !important;
    font-weight: 500;
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-warning:hover,
.btn-danger:hover {
    color: white !important;
    opacity: 0.9;
}

.dropdown-toggle.btn,
.btn.btn-default {
    color: white !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.dropdown-toggle.btn:hover,
.btn.btn-default:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: white !important;
}

/* Form Controls */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 0.9375rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: block;
}

/* Tiles (Client Home) */
.tiles {
    margin-bottom: 2rem;
}

.tiles .row {
    margin: 0 -0.75rem;
}

.tiles .row > [class*="col-"] {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.tile {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tile:hover::before {
    transform: scaleX(1);
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tile a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.tile .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tile .icon.text-primary {
    color: var(--primary-color);
}

.tile .icon.text-success {
    color: var(--success-color);
}

.tile .icon.text-danger {
    color: var(--error-color);
}

.tile .icon.text-warning {
    color: var(--warning-color);
}

.tile .stat {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    display: block;
}

.tile .title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
}

.tile .highlight {
    height: 4px;
    border-radius: 2px;
    margin-top: 1rem;
    width: 100%;
}

.tile .highlight.bg-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.tile .highlight.bg-success {
    background: linear-gradient(90deg, var(--success-color), #34d399);
}

.tile .highlight.bg-danger {
    background: linear-gradient(90deg, var(--error-color), #f87171);
}

.tile .highlight.bg-warning {
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
}

/* Client Home Panels */
.client-home-panels .panel {
    height: auto;
    min-height: auto;
}

.client-home-panels .panel-body {
    max-height: 200px;
    overflow-y: auto;
}

/* Search Box */
.home-kb-search {
    position: relative;
    margin-bottom: 2rem;
}

.home-kb-search .position-relative {
    position: relative;
    display: block;
}

.home-kb-search .form-control {
    padding-left: 3.5rem !important;
    font-size: 1rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    width: 100%;
}

.home-kb-search .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    outline: none;
}

.home-kb-search .position-absolute {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 10;
    pointer-events: none;
    font-size: 1rem;
}

.home-kb-search i.fas.fa-search {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 10;
    pointer-events: none;
    font-size: 1rem;
}

/* Tables */
.table {
    background-color: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.table thead th {
    background-color: var(--bg-gray);
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--secondary-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #ecfdf5;
    border-left-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: #fef2f2;
    border-left-color: var(--error-color);
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border-left-color: var(--accent-color);
    color: #1e40af;
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.pagination > li > a,
.pagination > li > span {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    color: var(--text-color);
    transition: var(--transition);
}

.pagination > li > a:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination > .active > a,
.pagination > .active > span {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Sidebar Improvements */
.sidebar .panel-sidebar {
    margin-bottom: 1.5rem;
}

.sidebar .panel-sidebar .panel-heading {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
}

.sidebar .panel-sidebar .panel-heading .panel-title {
    color: white !important;
}

.sidebar .panel-sidebar .panel-heading .panel-title i {
    color: white;
}

.sidebar .list-group-item {
    padding: 0.875rem 1.25rem;
}

.sidebar .list-group-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Login Page */
.logincontainer {
    max-width: 500px;
    margin: 3rem auto;
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.logincontainer .form-control {
    height: 3rem;
    font-size: 1rem;
}

.logincontainer .btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Page Header */
.header-lined {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    margin-top: 0;
    padding-top: 0;
}

/* When pageheader is in separate col-md-9, reduce spacing */
@media (min-width: 992px) {
    section#main-body .col-md-9.pull-md-right:first-of-type {
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    section#main-body .col-md-9.pull-md-right:first-of-type .header-lined {
        margin-bottom: 1rem;
    }
    
    /* Main content should be right after pageheader */
    section#main-body .col-md-9.pull-md-right.main-content {
        margin-top: 0;
        padding-top: 0;
    }
}

.header-lined h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.header-lined h1 small {
    font-size: 1.25rem;
    color: var(--text-light);
    font-weight: 400;
    display: block;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .header-lined h1 small {
        display: inline;
        margin-left: 0.75rem;
        margin-top: 0;
    }
}

.breadcrumb {
    background: transparent;
    padding: 0.5rem 0 0 0;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.breadcrumb > li + li:before {
    content: "›";
    color: var(--text-light);
    padding: 0 0.75rem;
    font-size: 1.2rem;
}

.breadcrumb > li > a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb > li > a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.breadcrumb > .active {
    color: var(--text-color);
    font-weight: 500;
}

/* Status Labels */
.status {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active,
.status-open,
.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-suspended {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Footer Styles */
footer.footer-modern {
    background: linear-gradient(to bottom, #1f2937 0%, #111827 100%);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 0;
    clear: both;
    position: relative;
    z-index: 1;
    width: 100%;
    display: block;
}

footer.footer-modern .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

footer.footer-modern .container::after {
    content: "";
    display: table;
    clear: both;
}

footer.footer-modern .row {
    margin-left: -15px;
    margin-right: -15px;
    display: block;
}

footer.footer-modern .row::before,
footer.footer-modern .row::after {
    content: "";
    display: table;
    clear: both;
}

.footer-content {
    margin-bottom: 2rem;
    display: block;
}

.footer-content::after {
    content: "";
    display: table;
    clear: both;
}

.footer-col {
    margin-bottom: 2rem;
    text-align: center;
    padding: 0 15px;
    box-sizing: border-box;
    position: relative;
    min-height: 1px;
}

/* Mobile: todas las columnas apiladas */
@media (max-width: 767px) {
    .footer-content [class*="col-"] {
        width: 100% !important;
        float: none !important;
        margin-bottom: 2rem;
    }
}

/* Tablet: primera columna arriba, otras dos al lado */
@media (min-width: 768px) and (max-width: 991px) {
    .footer-col {
        text-align: left;
        margin-bottom: 0;
    }
    
    .footer-content .col-sm-12 {
        width: 100%;
        float: none;
        margin-bottom: 2rem;
    }
    
    .footer-content .col-sm-6 {
        float: left;
        width: 50%;
    }
}

/* Desktop: todas las columnas en la misma fila */
@media (min-width: 992px) {
    .footer-col {
        text-align: left;
        margin-bottom: 0;
    }
    
    .footer-content .col-md-4 {
        float: left;
        width: 33.33333333%;
    }
    
    /* Override col-sm-12 en desktop para que sea 33.33% */
    .footer-content .col-md-4.col-sm-12 {
        width: 33.33333333% !important;
        float: left !important;
    }
    
    .footer-content .col-md-4.col-sm-6 {
        width: 33.33333333% !important;
        float: left !important;
    }
}

.footer-logo {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.footer-logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

.footer-text {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.75;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.footer-social {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .footer-social {
        justify-content: flex-start;
    }
}

.footer-link-icon {
    color: #9ca3af;
    font-size: 1.25rem;
    transition: color 0.3s ease;
    display: inline-block;
    margin: 0 0.5rem;
}

.footer-link-icon:hover {
    color: #06b6d4;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
}

.footer-links li {
    margin-bottom: 0.75rem;
    display: block;
}

.footer-links li:last-child {
    margin-bottom: 0;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1.5;
}

.footer-links a i {
    font-size: 0.75rem;
    margin-right: 0.75rem;
    width: 12px;
    flex-shrink: 0;
}

.footer-links a:hover {
    color: #06b6d4;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    margin-top: 2rem;
    clear: both;
    display: block;
}

.footer-bottom::after {
    content: "";
    display: table;
    clear: both;
}

.footer-copyright {
    text-align: center;
    padding: 0 15px;
}

.footer-copyright p {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.footer-copyright p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive Improvements */
@media (max-width: 991px) {
    .tile {
        margin-bottom: 1rem;
    }
    
    .client-home-panels .col-sm-6 {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .main-content {
        padding: 1rem;
    }
    
    .panel-body {
        padding: 1rem;
    }
    
    .tile {
        padding: 1.5rem;
    }
    
    .tile .stat {
        font-size: 2rem;
    }
    
    .logincontainer {
        padding: 2rem 1.5rem;
        margin: 2rem 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .tile .icon {
        font-size: 2rem;
    }
    
    .tile .stat {
        font-size: 1.75rem;
    }
    
    .panel-heading {
        padding: 1rem;
    }
    
    .panel-title {
        font-size: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--error-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--error-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-gray-600 {
    color: var(--text-light) !important;
}

.text-gray-900 {
    color: var(--text-color) !important;
}

/* Smooth Animations */
* {
    transition-property: color, background-color, border-color, transform, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar,
    section#header,
    section#main-menu,
    footer,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        box-shadow: none;
        padding: 0;
    }
}

