/* Iraqi Hosting Billing System - Main Stylesheet */

* {
 margin: 0;
 padding: 0;
 box-sizing: border-box;
}

body {
 font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
 background: #f5f7fa;
 min-height: 100vh;
 direction: ltr;
}

.container {
 max-width: 1400px;
 margin: 0 auto;
 padding: 20px;
}

/* Header */
.top-header {
 background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
 color: white;
 padding: 15px 0;
 box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
 max-width: 1400px;
 margin: 0 auto;
 padding: 0 20px;
 display: flex;
 justify-content: space-between;
 align-items: center;
}

.logo h2 {
 font-size: 1.5em;
 margin: 0;
}

.user-menu {
 display: flex;
 align-items: center;
 gap: 15px;
}

/* Navigation */
.main-nav {
 background: white;
 box-shadow: 0 2px 5px rgba(0,0,0,0.1);
 position: sticky;
 top: 0;
 z-index: 100;
}

.main-nav > ul {
 list-style: none;
 display: flex;
 max-width: 1400px;
 margin: 0 auto;
 padding: 0;
 overflow: visible;
}

.main-nav > ul > li {
 white-space: nowrap;
 position: relative;
}

.main-nav a {
 display: block;
 padding: 15px 20px;
 color: #495057;
 text-decoration: none;
 transition: all 0.3s;
 border-bottom: 3px solid transparent;
 font-weight: 600;
}

.main-nav > ul > li > a:hover {
 background: #f8f9fa;
 color: #2a5298;
}

.main-nav a.active {
 color: #2a5298;
 border-bottom-color: #2a5298;
 background: #f8f9fa;
}

/* Dropdown Menu */
.main-nav .dropdown {
    position: relative;
}

.main-nav .dropdown > a {
    cursor: pointer;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav .dropdown:hover > .dropdown-menu {
    display: block;
}

.main-nav .dropdown-menu li {
    white-space: nowrap;
    position: static;
}

.main-nav .dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s;
    font-weight: 500;
}

.main-nav .dropdown-menu li:last-child a {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.main-nav .dropdown-menu a:hover {
    background: #f8f9fa;
    color: #2a5298;
    padding-left: 25px;
}

.main-nav .dropdown-menu a.active {
    background: #e9ecef;
    color: #2a5298;
    border-bottom-color: transparent;
}

/* Page Header */
.page-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 30px;
 padding: 20px 0;
}

.page-header h1 {
 color: #2a5298;
 font-size: 2em;
}

/* Cards */
.card {
 background: white;
 border-radius: 10px;
 padding: 25px;
 margin-bottom: 20px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 20px;
 padding-bottom: 15px;
 border-bottom: 2px solid #e9ecef;
}

.card h2 {
 color: #2a5298;
 margin: 0;
 font-size: 1.5em;
}

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

.stat-card {
 background: white;
 padding: 24px 20px;
 border-radius: 16px;
 box-shadow: 0 4px 20px rgba(0,0,0,0.08);
 display: flex;
 align-items: center;
 gap: 16px;
 transition: all 0.3s ease;
 text-decoration: none;
 border: 1px solid transparent;
 position: relative;
 overflow: hidden;
}

.stat-card::before {
 content: '';
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 height: 4px;
 background: inherit;
 filter: brightness(0.85);
}

.stat-card:hover {
 transform: translateY(-6px);
 box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.stat-card .stat-icon {
 font-size: 2.5em;
 opacity: 0.9;
 min-width: 50px;
 text-align: center;
}

.stat-card .stat-content {
 flex: 1;
}

.stat-card .stat-content h3 {
 font-size: 1.75em;
 margin-bottom: 4px;
 font-weight: 700;
 letter-spacing: -0.5px;
 line-height: 1.2;
}

.stat-card .stat-content p {
 font-size: 0.875em;
 font-weight: 500;
 opacity: 0.9;
 margin: 0;
 letter-spacing: 0.2px;
}

.stat-primary {
 background: linear-gradient(145deg, #6366f1 0%, #8b5cf6 100%);
 color: white;
}

.stat-primary::before {
 background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
}

.stat-primary .stat-content h3,
.stat-primary .stat-content p {
 color: white;
}

.stat-success {
 background: linear-gradient(145deg, #10b981 0%, #34d399 100%);
 color: white;
}

.stat-success::before {
 background: linear-gradient(145deg, #059669 0%, #10b981 100%);
}

.stat-success .stat-content h3,
.stat-success .stat-content p {
 color: white;
}

.stat-warning {
 background: linear-gradient(145deg, #f59e0b 0%, #fbbf24 100%);
 color: white;
}

.stat-warning::before {
 background: linear-gradient(145deg, #d97706 0%, #f59e0b 100%);
}

.stat-warning .stat-content h3,
.stat-warning .stat-content p {
 color: white;
}

.stat-danger {
 background: linear-gradient(145deg, #ef4444 0%, #f87171 100%);
 color: white;
}

.stat-danger::before {
 background: linear-gradient(145deg, #dc2626 0%, #ef4444 100%);
}

.stat-danger .stat-content h3,
.stat-danger .stat-content p {
 color: white;
}

.stat-info {
 background: linear-gradient(145deg, #0ea5e9 0%, #38bdf8 100%);
 color: white;
}

.stat-info::before {
 background: linear-gradient(145deg, #0284c7 0%, #0ea5e9 100%);
}

.stat-info .stat-content h3,
.stat-info .stat-content p {
 color: white;
}

.stat-purple {
 background: linear-gradient(145deg, #8b5cf6 0%, #a78bfa 100%);
 color: white;
}

.stat-purple::before {
 background: linear-gradient(145deg, #7c3aed 0%, #8b5cf6 100%);
}

.stat-purple .stat-content h3,
.stat-purple .stat-content p {
 color: white;
}

/* Clickable Card Styles */
.clickable-card {
 cursor: pointer;
}

.clickable-card:active {
 transform: translateY(-2px);
}

/* Forms */
.form-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
 gap: 20px;
 margin-bottom: 20px;
}

.form-group {
 display: flex;
 flex-direction: column;
}

.form-group label {
 margin-bottom: 8px;
 font-weight: 600;
 color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
 padding: 12px;
 border: 2px solid #dee2e6;
 border-radius: 8px;
 font-size: 14px;
 transition: border-color 0.3s;
 font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
 outline: none;
 border-color: #2a5298;
}

.form-row {
 display: flex;
 gap: 15px;
 flex-wrap: wrap;
 align-items: end;
}

.form-row .form-group {
 flex: 1;
 min-width: 200px;
}

.filter-form {
 background: #f8f9fa;
 padding: 20px;
 border-radius: 8px;
}

.form-actions {
 display: flex;
 gap: 10px;
 margin-top: 20px;
 justify-content: flex-end;
}

/* Buttons */
.btn {
 padding: 10px 25px;
 border: none;
 border-radius: 8px;
 font-size: 14px;
 font-weight: 600;
 cursor: pointer;
 transition: all 0.3s;
 text-decoration: none;
 display: inline-block;
 text-align: center;
}

.btn-primary {
 background: #2a5298;
 color: white;
}

.btn-primary:hover {
 background: #1e3c72;
 transform: translateY(-2px);
 box-shadow: 0 5px 15px rgba(42, 82, 152, 0.3);
}

.btn-success {
 background: #28a745;
 color: white;
}

.btn-success:hover {
 background: #218838;
}

.btn-danger {
 background: #dc3545;
 color: white;
}

.btn-danger:hover {
 background: #c82333;
}

.btn-warning {
 background: #ffc107;
 color: #212529;
}

.btn-warning:hover {
 background: #e0a800;
}

.btn-info {
 background: #17a2b8;
 color: white;
}

.btn-info:hover {
 background: #138496;
}

.btn-secondary {
 background: #6c757d;
 color: white;
}

.btn-secondary:hover {
 background: #5a6268;
}

.btn-sm {
 padding: 6px 15px;
 font-size: 12px;
}

/* Tables */
.table-responsive {
 overflow-x: auto;
 margin-top: 20px;
}

table {
 width: 100%;
 border-collapse: collapse;
 background: white;
}

thead {
 background: #2a5298;
 color: white;
}

th, td {
 padding: 15px;
 text-align: right;
 border-bottom: 1px solid #dee2e6;
}

th {
 font-weight: 600;
 font-size: 14px;
 color: white;
}

tbody tr:hover {
 background: #f8f9fa;
}

tbody tr {
 transition: background 0.2s;
}

/* Badges */
.badge {
 display: inline-block;
 padding: 5px 12px;
 border-radius: 20px;
 font-size: 12px;
 font-weight: 600;
}

.badge-success {
 background: #d4edda;
 color: #155724;
}

.badge-active {
 background: #d4edda;
 color: #155724;
}

.badge-warning {
 background: #fff3cd;
 color: #856404;
}

.badge-danger {
 background: #f8d7da;
 color: #721c24;
}

.badge-info {
 background: #d1ecf1;
 color: #0c5460;
}

.badge-secondary {
 background: #e2e3e5;
 color: #383d41;
}

.badge-dark {
 background: #d6d8d9;
 color: #1b1e21;
}

/* Alerts */
.alert {
 padding: 15px 20px;
 border-radius: 8px;
 margin-bottom: 20px;
 font-weight: 500;
}

.alert-success {
 background: #d4edda;
 color: #155724;
 border: 1px solid #c3e6cb;
}

.alert-danger {
 background: #f8d7da;
 color: #721c24;
 border: 1px solid #f5c6cb;
}

.alert-warning {
 background: #fff3cd;
 color: #856404;
 border: 1px solid #ffeeba;
}

.alert-info {
 background: #d1ecf1;
 color: #0c5460;
 border: 1px solid #bee5eb;
}

/* Modal */
.modal {
 display: none;
 position: fixed;
 z-index: 1000;
 left: 0;
 top: 0;
 width: 100%;
 height: 100%;
 overflow: auto;
 background-color: rgba(0,0,0,0.5);
 animation: fadeIn 0.3s;
}

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

.modal-content {
 background-color: white;
 margin: 5% auto;
 padding: 30px;
 border-radius: 15px;
 width: 90%;
 max-width: 800px;
 box-shadow: 0 10px 40px rgba(0,0,0,0.3);
 animation: slideDown 0.3s;
}

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

.modal-small {
 max-width: 500px;
}

.modal-content h2 {
 color: #2a5298;
 margin-bottom: 20px;
}

.close {
 color: #aaa;
 float: left;
 font-size: 28px;
 font-weight: bold;
 cursor: pointer;
 transition: color 0.3s;
}

.close:hover {
 color: #000;
}

/* Footer */
.main-footer {
 background: #2a5298;
 color: white;
 padding: 20px 0;
 text-align: center;
 margin-top: 50px;
}

.footer-content p {
 margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
 .stats-grid {
 grid-template-columns: 1fr;
 }
 
 .form-grid {
 grid-template-columns: 1fr;
 }
 
 .page-header {
 flex-direction: column;
 align-items: flex-start;
 gap: 15px;
 }
 
 .header-content {
 flex-direction: column;
 gap: 15px;
 text-align: center;
 }
 
 .main-nav ul {
 flex-direction: column;
 }
 
 .table-responsive {
 font-size: 14px;
 }
 
 th, td {
 padding: 10px;
 }
}

/* Print Styles */
@media print {
 .main-nav, .page-header button, .btn, .form-actions {
 display: none;
 }
 
 body {
 background: white;
 }
 
 .card {
 box-shadow: none;
 border: 1px solid #dee2e6;
 }
}

/* Invoice Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideDown 0.3s;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5em;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #ff6b6b;
    transform: scale(1.2);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.items-table th {
    background: #2a5298;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #2a5298;
    color: #ffffff;
}

.items-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .items-table {
        font-size: 12px;
    }
    
    .items-table input,
    .items-table select {
        padding: 5px;
        font-size: 12px;
    }
}
/* View Details Table */
.view-details-table {
    width: 100%;
    border-collapse: collapse;
}

.view-details-table th,
.view-details-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

.view-details-table th {
    background: #f8f9fa;
    font-weight: 600;
    width: 35%;
    color: #495057;
}

.view-details-table td {
    color: #212529;
}

.view-details-table tr:hover {
    background: #f8f9fa;
}

/* Staff Management Styles */
.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #2a5298;
}

.tab-btn.active {
    color: #2a5298;
    border-bottom-color: #2a5298;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Staff Cards */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.staff-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.staff-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.staff-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.staff-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5em;
}

.staff-info h3 {
    margin: 0;
    color: #212529;
}

.staff-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.staff-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.staff-details p {
    margin: 5px 0;
    color: #495057;
}

/* Expense Categories */
.expense-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.expense-summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.expense-summary-card h4 {
    margin: 0 0 10px;
    color: #6c757d;
    font-size: 0.9em;
}

.expense-summary-card .amount {
    font-size: 1.5em;
    font-weight: 700;
    color: #2a5298;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
}
