@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    /* Professional Pastel Palette */
    --primary-color: #64748b;
    /* Soft Slate for primary text/icons */
    --secondary-color: #475569;
    /* Darker Slate for headings */

    --accent-color: #7dd3fc;
    /* Pastel Blue */
    --accent-hover: #38bdf8;

    --text-color: #334155;
    /* Slate 700 */
    --text-light: #f8fafc;

    --bg-color: #f8fafc;
    /* Very light slate/white background */
    --white: #ffffff;

    /* Pastel Status Colors */
    --success: #86efac;
    /* Pastel Green */
    --warning: #fdba74;
    /* Pastel Orange */
    --danger: #fca5a5;
    /* Pastel Red */

    --sidebar-width: 60px;
    /* Rediseño para iconos solamente */
    --header-height: 50px;
    --border-radius: 12px;
    /* Reduced radius for compact feel */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Softer shadows */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    --transition: all 0.2s ease-in-out;
    /* Faster transitions for compact UI */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Hide body scrollbar, use main-content scroll instead */
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
}

/* Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.025em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Login Page with Equipment Background */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.9)),
        url('../img/total_station.png');
    /* Using local asset */
    background-size: cover;
    background-position: center;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-logo {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.login-logo img.gnss-logo {
    height: 120px;
    width: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-logo div {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition);
    gap: 0.5rem;
}

.btn-primary {
    background: var(--tech-accent);
    color: var(--white);
    border: 1px solid var(--tech-accent);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--tech-accent-hover);
    border-color: var(--tech-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Main Content Area */
.main-content {
    flex: 1;
    background-color: #f0f2f5;
    padding: 0;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.content-header h1 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Dashboard Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.5), transparent);
    border-radius: 0 0 0 100%;
}

.stat-info h3 {
    font-size: 1.75rem;
    margin-bottom: 0.15rem;
    color: var(--secondary-color);
}

.stat-info p {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.95rem;
}

thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-pending {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.badge-done {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #d1fae5;
}

/* Print */
@media print {

    html,
    body {
        height: auto !important;
        overflow: visible !important;
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-container {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    .sidebar,
    .btn,
    .content-header a,
    .no-print,
    .topbar-nav-links,
    .topbar-right,
    .mobile-header,
    #dashboardModal,
    .modal-backdrop,
    .global-changelog,
    .btn-ribbon-search {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        height: auto !important;
        display: block !important;
    }

    .premium-container {
        padding: 15mm !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        background: transparent !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #eee !important;
        break-inside: avoid;
        margin-bottom: 20px !important;
    }

    a {
        text-decoration: none !important;
        color: black !important;
    }

    /* Keep ribbon simple for print if it stays */
    .global-topbar {
        background: white !important;
        border-bottom: 2px solid #334155 !important;
        height: auto !important;
        min-height: auto !important;
        margin-bottom: 20px !important;
        color: black !important;
        box-shadow: none !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .ribbon-pill {
        border: 1px solid #ccc !important;
        background: transparent !important;
        color: black !important;
    }

    .ribbon-label {
        color: black !important;
    }

    /* KPI Cards inline in print */
    .row>.col-md-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
        float: left !important;
    }
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .app-container {
        flex-direction: column;
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 250px;
        transition: var(--transition);
        display: flex;
        flex-direction: column;
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-header {
        justify-content: space-between !important;
        padding: 0 1rem !important;
    }

    .sidebar-header h3 {
        display: block !important;
    }

    .sidebar-header button.d-md-none {
        display: block !important;
    }

    .nav-links li {
        justify-content: flex-start;
        padding: 0 1rem;
    }

    .nav-links li a {
        width: 100%;
        justify-content: flex-start;
        padding: 0 1rem;
        gap: 1rem;
    }

    .nav-links li a span:not(.badge):not(.sidebar-icon-text) {
        display: block;
        font-size: 0.95rem;
        font-weight: 500;
    }

    .nav-links li a i {
        font-size: 1.15rem;
    }

    .sidebar-user-profile {
        padding: 1rem;
        flex-direction: row;
        justify-content: flex-start;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        margin: 0;
        gap: 1rem;
    }

    .user-info {
        display: block;
    }

    .main-content {
        width: 100%;
        padding: 0;
        margin-top: var(--topbar-height, 115px);
        /* Space for fixed mobile header */
    }

    .mobile-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        height: 60px;
        justify-content: space-between;
        align-items: center;
        background: #0f172a;
        color: white;
        padding: 0 1.25rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .mobile-header h3 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--accent-color);
    }

    .menu-toggle {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Helper for mobile header visibility */
.mobile-header {
    display: none;
}

/* Kanban Board Styles */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
    /* Columns start at top */
    min-height: 500px;
    overflow-x: auto;
    padding-bottom: 2rem;
}

.kanban-column {
    background: #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 280px;
    /* Ensure columns don't squish too much */
}

.kanban-column h3 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-cards-container {
    min-height: 100px;
    /* Drop zone area */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kanban-card {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.kanban-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.kanban-card-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    align-items: center;
}

.kanban-card-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Mobile Kanban */
@media screen and (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: 1fr;
        /* Stack columns on tablet/mobile */
    }
}

/* Sidebar Sections */
.sidebar-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #90a4ae;
    /* Blue Grey */
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-section:first-of-type {
    border-top: none;
    margin-top: 0;
}

/* === UNIFIED MODULE HEADER === */
.module-header {
    position: relative;
    height: 100px;
    /* Compact but impactful */
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    background-size: cover;
    background-position: center;
    background-color: var(--primary-color);
    /* Fallback */
}

.module-header .header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.7) 100%);
    z-index: 1;
}

.module-header .header-content {
    position: relative;
    z-index: 2;
    padding: 1rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.module-header h1 {
    color: white;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.module-header p {
    color: #94a3b8;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
}

/* TABLE ACTIONS / TOOLBAR */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 350px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-box input:focus {
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.2);
    outline: none;
}

/* =========================================
   NEW DASHBOARD STYLES
   ========================================= */

/* Welcome Banner */
.welcome-banner {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    background-image: linear-gradient(120deg, #fff 0%, #f0f9ff 100%);
    border: 1px solid #e2e8f0;
}

.welcome-text h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--secondary-color);
}

.welcome-text p {
    color: #64748b;
    font-size: 0.95rem;
}

.welcome-date {
    background: #e0f2fe;
    color: #0284c7;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.1);
}

/* Pastel Cards */
.stats-link {
    text-decoration: none;
    display: block;
}

.pastel-blue {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
}

.pastel-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

.pastel-orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    /* Orange-ish */
    color: #c2410c;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stat-info h3,
.stat-info p {
    color: inherit;
}

/* Tech Showcase Grid */
.tech-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tech-card {
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.tech-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tech-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s;
}

.tech-card:hover img {
    transform: scale(1.1);
}

.tech-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Changelog Styles */
.changelog-card {
    border: 1px solid #e2e8f0;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.changelog-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.changelog-date {
    min-width: 120px;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.changelog-content {
    flex: 1;
    padding-left: 1.5rem;
    border-left: 2px solid #e2e8f0;
}

.changelog-content strong {
    display: block;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.changelog-content p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Mobile Adjustments for new elements */
/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }

    .welcome-date {
        align-self: flex-start;
    }

    .tech-showcase-grid {
        grid-template-columns: 1fr;
    }

    .changelog-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .changelog-date {
        min-width: auto;
        display: inline-block;
    }

    .changelog-content {
        padding-left: 0;
        border-left: none;
    }
}
/* Global Modal Overrides for Topbar Compatibility */
.modal { z-index: 2000000 !important; }
.modal-backdrop { z-index: 1999999 !important; }
.swal2-container { z-index: 2000001 !important; }
