@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

@theme {
    --font-sans: 'Cairo', ui-sans-serif, system-ui, sans-serif;
    --color-smk-primary: #0F5132;
    --color-smk-gold: #C48A2C;
    --color-smk-bg: #F5F6F7;
    --color-smk-text: #2D3436;
}

@layer base {
    html { scroll-behavior: smooth; }
    body {
        background-color: #F5F6F7;
        color: #2D3436;
        font-family: 'Cairo', sans-serif;
        font-weight: 400;
        -webkit-font-smoothing: antialiased;
    }
    [x-cloak] { display: none !important; }
}

@layer components {
    /* ─── Sidebar 280px gradient ─── */
    .admin-sidebar {
        width: 280px;
        background: linear-gradient(180deg, #0B5D3B 0%, #0F5132 45%, #084C2E 100%);
        box-shadow: -2px 0 16px rgba(0, 0, 0, 0.15);
        overflow: hidden;
    }

    .sidebar-nav {
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .sidebar-section-title {
        margin: 16px 12px 6px;
        font-size: 11px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.35);
        letter-spacing: 0.02em;
    }

    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 8px 2px;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.72);
        transition: background 0.15s, color 0.15s;
        border-right: 3px solid transparent;
    }

    .sidebar-link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.95);
    }

    .sidebar-link-active {
        background: rgba(255, 255, 255, 0.11);
        color: #ffffff;
        font-weight: 600;
        border-right-color: #C48A2C;
        box-shadow: inset 0 0 0 1px rgba(196, 138, 44, 0.15);
    }

    .sidebar-link svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        opacity: 0.8;
    }

    .sidebar-link-active svg { opacity: 1; }

    .sidebar-link-label { flex: 1; text-align: right; }

    .sidebar-logout {
        color: rgba(252, 165, 165, 0.9) !important;
    }
    .sidebar-logout:hover {
        background: rgba(239, 68, 68, 0.1) !important;
    }

    /* ─── Header ─── */
    .admin-header {
        height: 64px;
        background: #ffffff;
        border-bottom: 1px solid #E8EAED;
    }

    .admin-search {
        height: 40px;
        width: 100%;
        max-width: 480px;
        padding: 0 16px 0 40px;
        border-radius: 10px;
        border: 1px solid #E5E7EB;
        background: #F5F6F7;
        font-size: 13px;
        font-weight: 400;
        color: #2D3436;
    }
    .admin-search:focus {
        outline: none;
        border-color: #0F5132;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.08);
    }

    .header-icon-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        color: #6B7280;
        transition: background 0.15s;
    }
    .header-icon-btn:hover { background: #F3F4F6; }

    /* ─── Cards ─── */
    .dash-card {
        background: #FFFFFF;
        border-radius: 16px;
        border: 1px solid #EBEDF0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .stat-card {
        background: #FFFFFF;
        border-radius: 16px;
        border: 1px solid #EBEDF0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        padding: 20px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .btn-refresh {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        padding: 0 18px;
        border-radius: 10px;
        background: #0F5132;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        transition: background 0.15s;
    }
    .btn-refresh:hover { background: #0B5D3B; }

    .date-picker-box {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        height: 40px;
        padding: 0 16px;
        border-radius: 10px;
        border: 1px solid #E5E7EB;
        background: #fff;
        font-size: 13px;
        font-weight: 500;
        color: #2D3436;
    }

    .admin-table th {
        padding: 12px 16px;
        text-align: right;
        font-size: 11px;
        font-weight: 600;
        color: #9CA3AF;
        background: #FAFBFC;
        white-space: nowrap;
    }

    .admin-table td {
        padding: 12px 16px;
        font-size: 13px;
        font-weight: 400;
        color: #2D3436;
        border-top: 1px solid #F3F4F6;
    }

    .status-badge {
        display: inline-flex;
        align-items: center;
        padding: 3px 10px;
        border-radius: 9999px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
    }

    .alert-row {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid #F3F4F6;
    }
    .alert-row:last-child { border-bottom: none; }

    .alert-icon-box {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* ═══════════════════════════════════════
       Forms & Admin UI Components
       ═══════════════════════════════════════ */

    .admin-card {
        background: #FFFFFF;
        border-radius: 16px;
        border: 1px solid #EBEDF0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .admin-label {
        display: block;
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
    }

    .admin-input,
    .admin-select,
    .admin-textarea {
        display: block;
        width: 100%;
        min-height: 42px;
        padding: 10px 14px;
        border-radius: 10px;
        border: 1px solid #D1D5DB;
        background-color: #FFFFFF;
        font-family: 'Cairo', sans-serif;
        font-size: 14px;
        font-weight: 400;
        color: #2D3436;
        line-height: 1.5;
        transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
        appearance: none;
        -webkit-appearance: none;
    }

    .admin-textarea {
        min-height: 96px;
        resize: vertical;
    }

    .admin-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: left 12px center;
        background-size: 16px;
        padding-left: 36px;
        cursor: pointer;
    }

    .admin-input::placeholder,
    .admin-textarea::placeholder {
        color: #9CA3AF;
    }

    .admin-input:hover,
    .admin-select:hover,
    .admin-textarea:hover {
        border-color: #9CA3AF;
    }

    .admin-input:focus,
    .admin-select:focus,
    .admin-textarea:focus {
        outline: none;
        border-color: #0F5132;
        background-color: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.12);
    }

    .admin-input:disabled,
    .admin-select:disabled,
    .admin-textarea:disabled {
        background-color: #F3F4F6;
        color: #9CA3AF;
        cursor: not-allowed;
    }

    .admin-input[type="file"] {
        padding: 8px 14px;
        cursor: pointer;
        background-color: #F9FAFB;
    }

    .admin-input[type="file"]::file-selector-button {
        margin-left: 12px;
        padding: 6px 14px;
        border: none;
        border-radius: 8px;
        background: #0F5132;
        color: #fff;
        font-family: 'Cairo', sans-serif;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }

    .admin-input[type="date"],
    .admin-input[type="number"],
    .admin-input[type="email"],
    .admin-input[type="password"],
    .admin-input[type="search"] {
        cursor: text;
    }

    .admin-form-group {
        margin-bottom: 16px;
    }

    .admin-checkbox {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        font-size: 14px;
        color: #374151;
    }

    .admin-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
        border-radius: 5px;
        border: 1px solid #D1D5DB;
        accent-color: #0F5132;
        cursor: pointer;
    }

    .admin-btn-primary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 10px 20px;
        border-radius: 10px;
        border: none;
        background: #0F5132;
        color: #FFFFFF;
        font-family: 'Cairo', sans-serif;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s, box-shadow 0.15s;
        box-shadow: 0 1px 2px rgba(15, 81, 50, 0.2);
    }

    .admin-btn-primary:hover {
        background: #0B5D3B;
    }

    .admin-btn-primary:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.25);
    }

    .admin-btn-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 10px 20px;
        border-radius: 10px;
        border: 1px solid #D1D5DB;
        background: #FFFFFF;
        color: #374151;
        font-family: 'Cairo', sans-serif;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
    }

    .admin-btn-secondary:hover {
        background: #F9FAFB;
        border-color: #9CA3AF;
    }

    .admin-btn-danger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 10px 20px;
        border-radius: 10px;
        border: 1px solid #FCA5A5;
        background: #DC2626;
        color: #FFFFFF;
        font-family: 'Cairo', sans-serif;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s, box-shadow 0.15s;
        box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    }

    .admin-btn-danger:hover {
        background: #B91C1C;
    }

    .admin-table td .admin-btn-primary,
    .admin-table td .admin-btn-danger,
    .admin-table td .admin-btn-secondary {
        color: inherit;
    }

    .admin-table td .admin-btn-primary {
        color: #FFFFFF;
    }

    .admin-table td .admin-btn-danger {
        color: #FFFFFF;
    }

    .admin-badge {
        display: inline-flex;
        align-items: center;
        padding: 4px 10px;
        border-radius: 9999px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
    }

    .admin-filter-bar {
        background: #FFFFFF;
        border-radius: 16px;
        border: 1px solid #EBEDF0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        padding: 16px;
        margin-bottom: 24px;
    }

    /* Modal */
    .admin-modal-overlay {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(0, 0, 0, 0.5);
    }

    .admin-modal {
        position: relative;
        z-index: 51;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px;
        background: #FFFFFF;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    }

    .admin-modal-header {
        padding: 20px 24px;
        border-bottom: 1px solid #F3F4F6;
    }

    .admin-modal-header h3 {
        font-size: 18px;
        font-weight: 700;
        color: #2D3436;
    }

    .admin-modal-body {
        padding: 24px;
    }

    .admin-modal-footer {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        padding: 16px 24px;
        border-top: 1px solid #F3F4F6;
        background: #FAFBFC;
        border-radius: 0 0 16px 16px;
    }

    .admin-error {
        display: block;
        margin-top: 4px;
        font-size: 12px;
        color: #DC2626;
    }

    /* Page header */
    .admin-page-title {
        font-size: 22px;
        font-weight: 700;
        color: #2D3436;
    }

    .admin-page-desc {
        margin-top: 4px;
        font-size: 13px;
        color: #9CA3AF;
    }

    /* Action links in tables */
    .admin-action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
        border-radius: 8px;
        border: none;
        background: transparent;
        cursor: pointer;
        transition: background 0.15s;
    }

    .admin-action-edit { color: #2563EB; }
    .admin-action-edit:hover { background: #EFF6FF; }
    .admin-action-delete { color: #DC2626; }
    .admin-action-delete:hover { background: #FEF2F2; }

    .admin-action-link {
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        border: none;
        background: transparent;
        transition: background 0.15s;
    }

    .admin-action-link--edit { color: #2563EB; }
    .admin-action-link--edit:hover { background: #EFF6FF; }
    .admin-action-link--delete { color: #DC2626; }
    .admin-action-link--delete:hover { background: #FEF2F2; }
}
