/*
 * FILE: assets/css/tk-portal.css
 *
 * WHAT THIS DOES:
 * Styles everything the customer/employee sees:
 *   - Login form card
 *   - Password reset forms
 *   - Dashboard layout (sidebar + main content)
 *   - Document tables, stats cards, profile display
 *   - Buttons, inputs, alerts
 *
 * Color scheme: Thomas Kohl dark blue (#1E3A5F) + white/light gray
 */

/* =============================================
   CSS VARIABLES — change colors here once,
   they update everywhere automatically
   ============================================= */
:root {
    --tk-primary: #1E3A5F;
    --tk-primary-light: #2d507d;
    --tk-primary-dark: #11233d;
    --tk-accent: #3669a8;
    --tk-text: #333333;
    --tk-text-light: #666666;
    --tk-bg: #f5f7f6;
    --tk-white: #ffffff;
    --tk-border: #e0e4e2;
    --tk-success: #28a745;
    --tk-error: #dc3545;
    --tk-warning: #ffc107;
    --tk-radius: 8px;
    --tk-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --tk-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* =============================================
   LOGIN FORM
   ============================================= */
.tk-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.tk-login-card {
    background: var(--tk-white);
    border-radius: var(--tk-radius);
    box-shadow: var(--tk-shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.tk-login-header {
    background: var(--tk-primary);
    padding: 30px;
    text-align: center;
}

.tk-login-header h2 {
    color: var(--tk-white);
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.tk-login-header .tk-login-logo {
    max-width: 180px;
    margin: 0 auto 12px auto !important;
    display: block !important;
}

.tk-login-header .tk-login-logo img {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    height: auto !important;
}

.tk-login-body {
    padding: 30px;
}

.tk-form-group {
    margin-bottom: 20px;
}

.tk-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--tk-text);
    font-size: 14px;
}

.tk-form-group input[type="text"],
.tk-form-group input[type="email"],
.tk-form-group input[type="password"],
.tk-form-group input[type="number"],
.tk-form-group input[type="date"],
.tk-form-group input[type="tel"],
.tk-form-group textarea,
.tk-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--tk-border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--tk-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tk-form-group input:focus,
.tk-form-group textarea:focus,
.tk-form-group select:focus {
    outline: none;
    border-color: var(--tk-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.tk-btn,
.tk-login-card .tk-btn,
.tk-dashboard .tk-btn {
    display: inline-block !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    text-align: center !important;
    text-decoration: none !important;
}

.tk-btn:active {
    transform: scale(0.98) !important;
}

.tk-btn-primary,
.tk-login-card .tk-btn-primary {
    background: var(--tk-primary) !important;
    color: var(--tk-white) !important;
    width: 100% !important;
    border: none !important;
    display: block !important;
}

.tk-btn-primary:hover,
.tk-login-card .tk-btn-primary:hover {
    background: var(--tk-primary-light) !important;
}

.tk-btn-secondary {
    background: transparent;
    color: var(--tk-primary);
    border: 1px solid var(--tk-primary);
}

.tk-btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

.tk-login-footer {
    text-align: center;
    padding: 0 30px 25px;
}

.tk-login-footer a {
    color: var(--tk-primary);
    text-decoration: none;
    font-size: 14px;
}

.tk-login-footer a:hover {
    text-decoration: underline;
}

/* Alert messages */
.tk-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.tk-alert-error {
    background: #fce4e4;
    color: var(--tk-error);
    border: 1px solid #f5c6cb;
}

.tk-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tk-alert.visible {
    display: block;
}

/* Loading spinner */
.tk-loading {
    display: none;
    text-align: center;
    padding: 10px;
}

.tk-loading.visible {
    display: block;
}

.tk-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--tk-border);
    border-top-color: var(--tk-primary);
    border-radius: 50%;
    animation: tk-spin 0.7s linear infinite;
}

@keyframes tk-spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.tk-dashboard {
    display: flex;
    min-height: 80vh;
    background: var(--tk-bg);
    border-radius: var(--tk-radius);
    overflow: hidden;
    box-shadow: var(--tk-shadow);
}

/* Sidebar */
.tk-sidebar {
    width: 260px;
    background: var(--tk-primary);
    padding: 0;
    flex-shrink: 0;
}

.tk-sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tk-sidebar-header h3 {
    color: var(--tk-white);
    margin: 0 0 5px 0;
    font-size: 16px;
}

.tk-sidebar-header small {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.tk-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.tk-sidebar-nav li {
    margin: 0;
}

.tk-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.tk-sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--tk-white);
}

.tk-sidebar-nav a.active {
    background: rgba(255,255,255,0.12);
    color: var(--tk-white);
    border-left-color: var(--tk-accent);
    font-weight: 600;
}

.tk-sidebar-nav .tk-nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.tk-sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.tk-sidebar-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
}

.tk-sidebar-footer a:hover {
    color: var(--tk-white);
}

/* Main content area */
.tk-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.tk-main h2 {
    color: var(--tk-text);
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 600;
}

/* Tab panels */
.tk-tab-panel {
    display: none;
}

.tk-tab-panel.active {
    display: block;
}

/* =============================================
   STATS CARDS (dashboard overview)
   ============================================= */
.tk-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.tk-stat-card {
    background: var(--tk-white);
    padding: 20px;
    border-radius: var(--tk-radius);
    box-shadow: var(--tk-shadow);
    text-align: center;
}

.tk-stat-card .tk-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--tk-primary);
    display: block;
}

.tk-stat-card .tk-stat-label {
    font-size: 13px;
    color: var(--tk-text-light);
    margin-top: 4px;
}

/* =============================================
   DOCUMENT TABLES
   ============================================= */
.tk-doc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--tk-white);
    border-radius: var(--tk-radius);
    overflow: hidden;
    box-shadow: var(--tk-shadow);
}

.tk-doc-table thead {
    background: var(--tk-primary);
}

.tk-doc-table thead th {
    color: var(--tk-white);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tk-doc-table tbody tr {
    border-bottom: 1px solid var(--tk-border);
    transition: background 0.15s;
}

.tk-doc-table tbody tr:hover {
    background: #f8faf9;
}

.tk-doc-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--tk-text);
}

.tk-doc-table .tk-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--tk-primary);
    color: var(--tk-white);
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.tk-doc-table .tk-download-btn:hover {
    background: var(--tk-primary-light);
}

/* Pagination */
.tk-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.tk-pagination a,
.tk-pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--tk-border);
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    color: var(--tk-text);
}

.tk-pagination span.current {
    background: var(--tk-primary);
    color: var(--tk-white);
    border-color: var(--tk-primary);
}

/* =============================================
   PROFILE DISPLAY
   ============================================= */
.tk-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    background: var(--tk-white);
    padding: 30px;
    border-radius: var(--tk-radius);
    box-shadow: var(--tk-shadow);
}

.tk-profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tk-profile-label {
    font-size: 11px;
    color: var(--tk-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-left: 4px;
}

.tk-profile-value {
    font-size: 14px;
    color: var(--tk-text);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    border-radius: 100px;
    font-weight: 500;
    display: block;
    box-sizing: border-box;
}

/* =============================================
   PASSWORD CHANGE FORM
   ============================================= */
.tk-password-form {
    background: var(--tk-white);
    padding: 25px;
    border-radius: var(--tk-radius);
    box-shadow: var(--tk-shadow);
    max-width: 480px;
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .tk-dashboard {
        flex-direction: column;
    }

    .tk-sidebar {
        width: 100%;
    }

    .tk-sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 5px 10px;
    }

    .tk-sidebar-nav a {
        padding: 10px 15px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .tk-sidebar-nav a.active {
        border-left-color: transparent;
        border-bottom-color: var(--tk-accent);
    }

    .tk-sidebar-header {
        padding: 15px 20px;
    }

    .tk-main {
        padding: 20px 15px;
    }

    .tk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tk-profile-grid {
        grid-template-columns: 1fr;
    }

    .tk-doc-table {
        font-size: 13px;
    }

    .tk-doc-table thead th,
    .tk-doc-table tbody td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .tk-stats-grid {
        grid-template-columns: 1fr;
    }

    .tk-login-card {
        margin: 0 10px;
    }
}
