/* public/css/style.css - Adwise Labs Professional Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Colors (Derived from Adwise Labs Logo) */
    --primary: #e11d48;
    --primary-hover: #be123c;
    --primary-dark: #9f1239;
    --primary-light: #fff1f2;
    --primary-subtle: #ffe4e6;
    --primary-glow: rgba(225, 29, 72, 0.2);
    
    /* Neutrals & Dark Charcoal */
    --charcoal-dark: #0f172a;
    --charcoal-body: #1e293b;
    --charcoal-muted: #64748b;
    --charcoal-subtle: #94a3b8;
    
    /* Surfaces & Backgrounds */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --topbar-bg: #ffffff;
    
    /* Borders & Lines */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-brand: #fecdd3;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-brand: 0 4px 14px 0 rgba(225, 29, 72, 0.25);
    
    /* Legacy aliases for backward compatibility */
    --primary-blue: #e11d48;
    --primary-dark-legacy: #0f172a;
    --accent-orange: #f43f5e;
    --accent-red: #be123c;
    --text-main: #1e293b;
    --text-light: #64748b;
    --glass-border: #e2e8f0;
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { 
    font-weight: 700; 
    color: var(--charcoal-dark); 
    letter-spacing: -0.02em;
}
a { 
    text-decoration: none; 
    color: var(--primary); 
    transition: color 0.15s ease;
}
a:hover { 
    color: var(--primary-hover); 
}

/* Gradients & Text utilities */
.text-gradient {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 50%, #0f172a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.25;
}

.btn-primary {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff !important;
    box-shadow: var(--shadow-brand);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #be123c, #9f1239);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.35);
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--charcoal-body);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Auth Pages (Login / Register) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #fff1f2 0%, #f8fafc 50%, #f1f5f9 100%);
    padding: 20px;
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.auth-card .logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 25px;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--charcoal-dark);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px var(--primary-glow);
}

.form-control::placeholder {
    color: #94a3b8;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #475569;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 64px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 90;
}

.content-body {
    padding: 32px;
    flex-grow: 1;
}

/* Dashboard & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 22px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-brand);
}

.stat-title {
    font-size: 12px;
    color: var(--charcoal-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--charcoal-dark);
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--charcoal-dark);
    margin-bottom: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px;
}

th {
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    background: #f8fafc;
}

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

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: capitalize;
}
.badge-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #a7f3d0; }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #fde68a; }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #fecaca; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--border-brand); }

/* 3-Dots Action Dropdown Menu */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.btn-dots {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s ease;
    font-weight: bold;
    user-select: none;
}

.btn-dots:hover, .btn-dots.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--border-brand);
}

.action-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    min-width: 160px;
    padding: 6px;
    z-index: 99999;
    display: none;
    animation: dropdownFadeIn 0.15s ease-out;
}

.action-menu.show {
    display: block;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.action-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.action-item.delete {
    color: var(--danger);
}

.action-item.delete:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.action-item.success {
    color: var(--success);
}

.action-item.success:hover {
    background: var(--success-bg);
    color: var(--success-text);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Print Invoice & Documents */
@page {
    size: auto;
    margin: 0mm;
}

@media print {
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .sidebar, .topbar, .btn, .action-dropdown, .no-print, nav, header, aside {
        display: none !important;
    }
    .app-container, .main-content {
        margin-left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .content-body, .page-content {
        padding: 0 !important;
        margin: 0 !important;
    }
    .card {
        box-shadow: none !important;
        border: none !important;
    }
}